<%--
  Created by IntelliJ IDEA.
  User: teacher
  Date: 2022/12/12
  Time: 11:36
  To change this template use File | Settings | File Templates.
--%>
<!--
    errorPage="xxx.jsp":
    表示当前页面如果没有异常,正常运行
    当前页面如果出现异常,跳转到xxx.jsp页面进行异常处理
-->
<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" language="java" errorPage="test.jsp" %>
<html>
<head>
    <title>sayHello</title>
</head>
<body>
<%--<jsp:forward page="../findAll"></jsp:forward>--%>
<%
    int num = 1/0;
    // Java代码
    for(int i = 0; i < 10; i++){
%>
<h1>Hello JSP</h1>
<%
    }
%>
应用名:
<%
    String path = request.getContextPath();
    out.print(path);
%><br>
应用名:<%=request.getContextPath()%>
<%!
    // 全局定义
    int i = 1;
%>
name:<%=application.getAttribute("name")%>
</body>
</html>
